Skip to content

Fixed: only load author/category pageview props on posts.#296

Merged
Dan0sz merged 4 commits intodevelopfrom
fix_pageview_props
May 5, 2026
Merged

Fixed: only load author/category pageview props on posts.#296
Dan0sz merged 4 commits intodevelopfrom
fix_pageview_props

Conversation

@Dan0sz
Copy link
Copy Markdown
Collaborator

@Dan0sz Dan0sz commented May 5, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Pageview property tracking now applies exclusively to single post pages, preventing unintended tracking in other contexts.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@Dan0sz has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 53 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b1219d7e-2f04-4b5c-8b3b-d57d083074eb

📥 Commits

Reviewing files that changed from the base of the PR and between 9564a78 and 09ac7f3.

📒 Files selected for processing (1)
  • tests/integration/InitOptionsTest.php
📝 Walkthrough

Walkthrough

A guard condition in maybe_add_pageview_props() is tightened to require both a valid WP_Post instance and single-post context before setting pageview properties. Docblock annotations in two methods are reordered for consistency. No public API changes.

Changes

Guard Condition Refinement & Documentation Reordering

Layer / File(s) Summary
Guard Logic
src/InitOptions.php
maybe_add_pageview_props() now checks both $post instanceof WP_Post and is_single() before proceeding, preventing pageview property injection in non-single-post contexts.
Docblock Formatting
src/InitOptions.php
Annotations in __construct() (lines 19–21) and maybe_track_logged_in_users() (lines 167–171) are reordered for consistent documentation layout without functional changes.

Poem

🐰 A stricter guard now stands so tall,
Pageviews only when singles call,
Docblocks shuffled, neat and clean,
The finest code I've ever seen!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main functional change: adding a condition to load author/category pageview props only on single posts, which is the core modification in the InitOptions::maybe_add_pageview_props() method.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_pageview_props

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Dan0sz Dan0sz merged commit 8c36f00 into develop May 5, 2026
7 checks passed
@Dan0sz Dan0sz deleted the fix_pageview_props branch May 5, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant